package com.blog.dao.sys;

import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import com.blog.dao.sys.sql.RoleSql;
import com.blog.entity.sys.Role;


@Mapper
public interface RoleDao {
		
	@Select(RoleSql.ROLE_List_Sql)
	List<Role> listRole(@Param("userId") Integer userId);
	
	@Delete(RoleSql.DELETE_USER_ROLE)
	Integer delectUserAndRole(Integer userIds);
	
	List<Role> listRoleTree(Map<String,Object> map);
	
	List<Role> selectRoleByUserId(Integer id);
	
	Integer saveRole(Role role);
	
	Integer updateRole(Role role);
	
	Role selectRoleByRoleId(Integer roleId);

	Integer delectRoleById(Integer roleId);
}
